package cn.edu.gzhu.workOrderManagement.pojo.dto.user;

import cn.edu.gzhu.workOrderManagement.constants.RegexConstant;
import cn.edu.gzhu.workOrderManagement.enumeration.UserAuthorityEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserUpdateDto {
    @NotBlank
    @Length(max = 31)
    private String username;

    @Length(max = 31)
    private String name;

    @Pattern(regexp = RegexConstant.PASSWORD)
    @Length(max = 64)
    /**
     * 新密码
     */
    private String password;
    /**
     * 原来的密码
     */
    private String oldPassword;

    private Integer teamId;

    private UserAuthorityEnum authority;
    @Length(max = 32)
    private String organization;

    private Boolean isAvailable;
}
